#pragma once

#include "..\cz_def.h"

#define cz_file_BrowseDirT							CZ_COMBINET(cz_file_BrowseDir, )
#define cz_file_DeletePathT							CZ_COMBINET(cz_file_DeletePath, )
#define cz_file_GetExeDirT							CZ_COMBINET(cz_file_GetExeDir, )
#define cz_file_GetExeDriveT						CZ_COMBINET(cz_file_GetExeDrive, )
#define cz_file_IsDirFormatT						CZ_COMBINET(cz_file_IsDirFormat, )
#define cz_file_IsPathExistsT						CZ_COMBINET(cz_file_IsPathExists, )

// the value of "flag" in function "cz_file_DeletePath"
typedef enum
{
	CZ_FILE_DEFAULT = 0,
	CZ_FILE_ERROR = 1,
	CZ_FILE_SKIP = 2

}_CZ_FILE_RESULT;


#define CZ_FILE_NULL								0x00000000

// the value of "flag" in function "cz_file_DeletePathX"
#define CZ_FILE_TO_RECOVERY							0x00000001

// browse
typedef _CZ_FILE_RESULT (WINAPI *cz_file_callback_BrowseDirW)(IN wstring& wcsPath, IN void* pUserData);
typedef _CZ_FILE_RESULT (WINAPI *cz_file_callback_BrowseDirA)(IN string& strPath, IN void* pUserData);

bool cz_file_BrowseDirW(IN wstringc& wcsDir, IN cz_file_callback_BrowseDirW pfDoBrowseDirW, IN void* pUserData);
bool cz_file_BrowseDirA(IN stringc& strDir, IN cz_file_callback_BrowseDirA pfDoBrowseDirA, IN void* pUserData);

// operate
bool cz_file_DeletePathW(IN wstringc& wcsPath, u32 flag = CZ_FILE_NULL);
bool cz_file_DeletePathA(IN stringc& strPath, u32 flag = CZ_FILE_NULL);

bool cz_file_RenamePathW(IN wstring& wcsPath, IN wstringc& wcsNewName);
bool cz_file_RenamePathA(IN string& strPath, IN stringc& strNewName);

// string
wstring cz_file_GetExeDirW();
string cz_file_GetExeDirA();

wstring cz_file_GetExeDriveW();
string cz_file_GetExeDriveA();

wstring cz_file_GetParentDirW(IN wstringc& wcsPath);
string cz_file_GetParentDirA(IN stringc& strPath);

wstring cz_file_GetPathNameW(IN wstringc& wcsPath);
string cz_file_GetPathNameA(IN stringc& strPath);

// check
bool cz_file_IsDirFormatW(IN wstringc& wcsPath);
bool cz_file_IsDirFormatA(IN stringc& strPath);

bool cz_file_IsPathExistsW(IN wstringc& wcsPath);
bool cz_file_IsPathExistsA(IN stringc& strPath);